#include <iostream>

class List {
	private:
		int *data;
		int size;
		int capacity;

		void resize() {
			int newCapacity = capacity * 2;
			int *newData = new int[newCapacity];
			for (int i = 0; i < size; i++) {
				newData[i] = data[i];
			}
			delete[] data;
			data = newData;
			capacity = newCapacity;
		}

	public:
		List() {
			size = 0;
			capacity = 10;
			data = new int[capacity];
		}

		~List() {
			delete[] data;
		}

		void enqueue(int element) {
			if (size == capacity) {
				resize();
			}
			data[size++] = element;
		}

		int dequeue() {
			if (size == 0) {
				std::cout << "List is empty. Cannot dequeue." << std::endl;
				return -1;
			}
			int element = data[0];
			for (int i = 0; i < size - 1; i++) {
				data[i] = data[i + 1];
			}
			size--;
			return element;
		}

		bool isEmpty() {
			return size == 0;
		}
};

int main() {
	List myList;
	myList.enqueue(10);
	myList.enqueue(20);
	myList.enqueue(30);

	std::cout << "Dequeued element: " << myList.dequeue() << std::endl;
	std::cout << "Dequeued element: " << myList.dequeue() << std::endl;

	return 0;
}